#pragma once

#include "Hash.h"

namespace wzw
{
	template <class K, class Hash = HashFunc<K>>
	class unordered_set
	{
		struct KeyOfValue
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

		typedef typename HashBucket<K, K, KeyOfValue, Hash>::Iterator iterator;
	public:
		iterator begin()
		{
			return _t.begin();
		}
		iterator end()
		{
			return _t.end();
		}
	public:
		// modifiers
		pair<iterator, bool> insert(const K& data)
		{
			return _t.Insert(data);
		}
		size_t erase(const K& key)
		{
			return _t.Erase(key);
		}
		void clear()
		{
			_t.Clear();
		}
		// find
		iterator find(const K& key)
		{
			return _t.Find(key);
		}
		size_t count(const K& key) const
		{
			return _t.Count(key);
		}
		// capacity
		bool empty() const
		{
			return _t.Empty();
		}
		size_t size() const
		{
			return _t.Size();
		}
	private:
		HashBucket<K, K, KeyOfValue, Hash> _t;
	};
}